---
title: recommended-alphabetical
description: Explore the recommended alphabetical ESLint Plugin Perfectionist configuration for sorting and organizing your code. Improve code readability and maintain a consistent coding style with this setup
shortDescription: All plugin rules with alphabetical sorting in ascending order
keywords:
  - eslint
  - recommended alphabetical config
  - eslint configuration
  - coding standards
  - code quality
  - javascript linting
  - alphabetical sorting
  - eslint-plugin-perfectionist
---

import CodeTabs from '../../components/CodeTabs.svelte'
import dedent from 'dedent'

Configuration for the `eslint-plugin-perfectionist` plugin, which provides all plugin rules with predefined options: alphabetical sorting in ascending order.

Uses [localeCompare](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare) to sort elements.

It makes it just a bit faster to find a declaration in a large list. Remember, you read code far more than you write it.

## When to Use

Use the `recommended-alphabetical` configuration when you want to enforce a consistent alphabetical order across various data structures in your codebase.

This configuration is particularly useful for large projects where readability and maintainability are crucial.

It helps quickly locate declarations and ensures that similar elements are grouped together, reducing cognitive load for developers navigating the code.

## Usage

<CodeTabs
  code={[
    {
      source: dedent`
        // eslint.config.js
        import perfectionist from 'eslint-plugin-perfectionist'

        export default [
          perfectionist.configs['recommended-alphabetical'],
        ]
      `,
      name: 'Flat Config',
      value: 'flat',
    },
    {
      source: dedent`
        // .eslintrc.js
        module.exports = {
          extends: [
            'plugin:perfectionist/recommended-alphabetical-legacy',
          ],
        }
      `,
      name: 'Legacy Config',
      value: 'legacy',
    },

]}
type="config-type"
client:load
lang="tsx"
/>

